{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">编辑用户表</h3>
	<table class="layui-table layui-table-form">
		<tr><td class="layui-td-gray-2">班级<font>*</font></td>
			<td><input type="text" name="bj_code"  lay-verify="required" lay-reqText="请完善班级" value="{$detail.bj_code}" autocomplete="off" placeholder="请输入班级" class="layui-input"></td><td class="layui-td-gray-2">学号<font>*</font></td>
			<td><input type="text" name="st_code"  lay-verify="required" lay-reqText="请完善学号" value="{$detail.st_code}" autocomplete="off" placeholder="请输入学号" class="layui-input"></td><td class="layui-td-gray-2">用户昵称</td>
			<td><input type="text" name="nickname"  value="{$detail.nickname}" autocomplete="off" placeholder="请输入用户昵称" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">账号<font>*</font></td>
			<td><input type="text" name="username"  lay-verify="required" lay-reqText="请完善账号" value="{$detail.username}" autocomplete="off" placeholder="请输入账号" class="layui-input"></td><td class="layui-td-gray-2">密码<font>*</font></td>
			<td><input type="text" name="password"  lay-verify="required" lay-reqText="请完善密码" value="{$detail.password}" autocomplete="off" placeholder="请输入密码" class="layui-input"></td><td class="layui-td-gray-2">密码盐</td>
			<td><input type="text" name="salt"  value="{$detail.salt}" autocomplete="off" placeholder="请输入密码盐" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">真实姓名<font>*</font></td>
			<td><input type="text" name="name"  lay-verify="required" lay-reqText="请完善真实姓名" value="{$detail.name}" autocomplete="off" placeholder="请输入真实姓名" class="layui-input"></td><td class="layui-td-gray-2">登录PC</td>
			<td><input type="text" name="login_pc"  value="{$detail.login_pc}" autocomplete="off" placeholder="请输入登录PC" class="layui-input"></td><td class="layui-td-gray-2">手机（也可以作为登录账号)</td>
			<td><input type="text" name="mobile"  value="{$detail.mobile}" autocomplete="off" placeholder="请输入手机（也可以作为登录账号)" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">邮箱</td>
			<td><input type="text" name="email"  value="{$detail.email}" autocomplete="off" placeholder="请输入邮箱" class="layui-input"></td><td class="layui-td-gray-2">身份证号</td>
			<td><input type="text" name="sfz"  value="{$detail.sfz}" autocomplete="off" placeholder="请输入身份证号" class="layui-input"></td><td class="layui-td-gray-2">微信头像</td>
			<td><input type="text" name="headimgurl"  value="{$detail.headimgurl}" autocomplete="off" placeholder="请输入微信头像" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">性别</td>
			<td>
				<input type="radio" name="sex" value="1" title="男" {eq name="$detail.sex" value="1"} checked{/eq}>
				<input type="radio" name="sex" value="2" title="女" {eq name="$detail.sex" value="2"} checked{/eq}>
			</td><td class="layui-td-gray-2">个人简介</td>
			<td><input type="text" name="desc"  value="{$detail.desc}" autocomplete="off" placeholder="请输入个人简介" class="layui-input"></td><td class="layui-td-gray-2">生日</td>
			<td><input type="text" name="birthday"  value="{$detail.birthday}" autocomplete="off" placeholder="请输入生日" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">国家</td>
			<td><input type="text" name="country"  value="{$detail.country}" autocomplete="off" placeholder="请输入国家" class="layui-input"></td>
			<td class="layui-td-gray-2">省</td>
			<td>
				<select name="province" >
					<option value="">请选择</option>
					<option value="浙江省" {eq name="$detail.province" value="浙江省"} selected{/eq}>浙江省</option>
					<option value="2" {eq name="$detail.province" value="2"} selected{/eq}>选项二</option>
				</select>
			</td><td class="layui-td-gray-2">城市</td>
			<td>
				<select name="city" >
					<option value="">请选择</option>
					<option value="天台县" {eq name="$detail.city" value="天台县"} selected{/eq}>天台县</option>
					<option value="外县" {eq name="$detail.city" value="外县"} selected{/eq}>外县</option>
				</select>
			</td>
		</tr>
				<tr><td class="layui-td-gray-2">学校</td>
			<td><input type="text" name="school"  value="{$detail.school}" autocomplete="off" placeholder="请输入学校" class="layui-input"></td><td class="layui-td-gray-2">家庭地址</td>
			<td><input type="text" name="address"  value="{$detail.address}" autocomplete="off" placeholder="请输入家庭地址" class="layui-input"></td><td class="layui-td-gray-2">部门</td>
			<td>
				<select name="depament" >
					<option value="">请选择</option>
					<option value="天台县外国语学校" {eq name="$detail.depament" value="1"} selected{/eq}>天台县外国语学校</option>
					<option value="2" {eq name="$detail.depament" value="2"} selected{/eq}>选项二</option>
				</select>
			</td>
		</tr>
				<tr><td class="layui-td-gray-2">职位</td>
			<td>
				<select name="position" >
					<option value="">请选择</option>
					<option value="1" {eq name="$detail.position" value="1"} selected{/eq}>选项一</option>
					<option value="2" {eq name="$detail.position" value="2"} selected{/eq}>选项二</option>
				</select>
			</td><td class="layui-td-gray-2">等级  默认是普通会员</td>
			<td><input type="text" name="level"  value="{$detail.level}" autocomplete="off" placeholder="请输入等级  默认是普通会员" class="layui-input"></td><td class="layui-td-gray-2">状态  -1删除 0禁用 1正常</td>
			<td><input type="text" name="status"  value="{$detail.status}" autocomplete="off" placeholder="请输入状态  -1删除 0禁用 1正常" class="layui-input"></td>
		</tr>
				
	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$detail.id}"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/user/edit", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->